<template>
  <!-- top -->
  <div class="search-top">
    <!-- 返回 -->
    <div class="left" @click="navBack">
      <slot name="left">
        <van-icon name="arrow-left"/>返回
      </slot>
    </div>
    <!-- 标题 -->
    <div class="center">
      <slot name="center">静静保洁公司.vant</slot>
    </div>
    <!-- 添加 -->
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopNav',

  data () {
    return {}
  },

  methods: {
    // 默认返回按钮
    navBack () {
      this.$router.go(-1)
    }
  }
}
</script>

<style scoped>
.search-top {
  display: flex;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #1989fa;
}

.left,
.right {
  width: 60px;
  color: #fff;
}

.center {
  flex: 1;
  color: #fff;
}

.van-icon {
  top: 1px;
}
</style>
